package com.bytedance.ttstat;

import android.app.Activity;
import android.app.Application;
import android.os.Bundle;

import com.bytedance.article.common.a.h;
import com.ss.android.newmedia.MediaAppData;

final class b implements Application.ActivityLifecycleCallbacks {
    private final com.bytedance.ttstat.a.a$a a;
    private final Application b;

    b(com.bytedance.ttstat.a.a$a arg1, Application arg2) {
        this.a = arg1;
        this.b = arg2;
    }

    private static boolean a(long arg2) {
        boolean v0 = arg2 > 0 ? true : false;
        return v0;
    }

    public final void onActivityCreated(Activity activity, Bundle savedInstanceState) {
        String v0_3;
        long v10 = 0;
        if (h.l() > v10) {
            MediaAppData mediaAppData = MediaAppData.provide();
            int v0_1 = mediaAppData.dh ? mediaAppData.lastVersionCode : mediaAppData.mContext.getSharedPreferences("app_setting", 0).getInt("last_version_code", 0);
            h.a(v0_1, this.a.a());
            c v0_2 = com.bytedance.ttstat.a.h(this.b);
            long v2 = v0_2.f - v0_2.e;
            long v4 = v0_2.g - v0_2.f;
            long v6 = v0_2.h - v0_2.g;
            v0_2.e = v10;
            v0_2.f = v10;
            v0_2.g = v10;
            v0_2.h = v10;
            boolean v1 = h.p();
            if (a(v2)) {
                v0_3 = v1 ? "appConstructor_first" : "appConstructor";
                android.support.design.a.a(v0_3, v2);
            }

            if (a(v4)) {
                v0_3 = v1 ? "appConstructorToOnCreate_first" : "appConstructorToOnCreate";
                android.support.design.a.a(v0_3, v4);
            }

            if (a(v6)) {
                v0_3 = v1 ? "appOnCreate_first" : "appOnCreate";
                android.support.design.a.a(v0_3, v6);
            }

            this.b.unregisterActivityLifecycleCallbacks(((Application.ActivityLifecycleCallbacks) this));
        }
    }

    public final void onActivityDestroyed(Activity arg1) {
    }

    public final void onActivityPaused(Activity arg1) {
    }

    public final void onActivityResumed(Activity arg1) {
    }

    public final void onActivitySaveInstanceState(Activity arg1, Bundle arg2) {
    }

    public final void onActivityStarted(Activity arg1) {
    }

    public final void onActivityStopped(Activity arg1) {
    }
}

